package com.example.yoga.mapper;

import com.example.yoga.entity.Combo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.yoga.entity.UsercomboStatusVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author liwenkai
 * @since 2021-02-03
 */
@Mapper
public interface ComboMapper extends BaseMapper<Combo> {

    @Select("SELECT COUNT(*) FROM combo")
    int getTotalCombo();

    @Select("SELECT comboId , COUNT(*) AS saleCount\n" +
            "FROM `user_combo`GROUP BY comboId")
    List<Map<String,Object>> getComboCount();

}
